//
//  Contacts.m
//  18-HomeWork-添加联系人
//
//  Created by dllo on 16/8/5.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "Contacts.h"

@implementation Contacts
- (instancetype)initWithHeadImageString:(NSString *)headImageString nameString:(NSString *)nameString phoneNumber:(NSString *)phoneNumber addressString:(NSString *)addressString {
    self = [super init];
    if (self) {
        _headImageString = headImageString;
        _nameString = nameString;
        _phoneNumber = phoneNumber;
        _addressString = addressString;
    }
    return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _headImageString = [aDecoder decodeObjectForKey:@"headImageString"];
        _nameString = [aDecoder decodeObjectForKey:@"nameString"];
        _phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        _addressString = [aDecoder decodeObjectForKey:@"addressString"];
    }
    return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_headImageString forKey:@"headImageString"];
    [aCoder encodeObject:_nameString forKey:@"nameString"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:_addressString forKey:@"addressString"];
    
}
@end
